<?php 

$_nav_menu_placeholder = -1000;

$homeUrl = "";
$aSetting = array('#services'=>'Services', '#aboutus'=>'About Us', '#ourteam'=>'Our Team', '#ourworks'=>'Our Works', '#ourclients'=>'Our Clients', '#contact'=>'Contact Us');
// $possible_object_id  =  -200;
?>

    <div id="posttype-edit-menu-item" class="posttypediv">
        <ul class="categorychecklist form-no-clear">    
            <?php foreach ($aSetting as $k => $v) : ?>
            <li>
                <label class="menu-item-title"> 
                    <input type="checkbox" name="qva[<?php echo $_nav_menu_placeholder ?>][menu-item-checked]" value="1" class="code pirates-qva-menu menu-item-textbox"/>
                    <input class="menu-item-object" type="hidden" value="custom" name="qva[<?php echo $_nav_menu_placeholder ?>][menu-item-object]">
                    <input  name="qva[<?php echo $_nav_menu_placeholder ?>][menu-item-url]" type="hidden" class="code pirates-qva-menu menu-item-textbox" value="<?php echo  $k; ?>" />
                    <input  name="qva[<?php echo $_nav_menu_placeholder ?>][menu-item-title]" type="hidden" class="pirates-qva-menu regular-text menu-item-textbox input-with-default-title" title="<?php esc_attr_e($v); ?>"  value="<?php echo $v; ?>"/>
                    <input class="menu-item-type" type="hidden" value="post_type" name="qva[<?php echo $_nav_menu_placeholder ?>][menu-item-type]">
                    <input class="menu-item-section-name" type="hidden" value="" name="qva[<?php echo $_nav_menu_placeholder - 1; ?>][menu-item-section-name]" value="<?php echo $k ?>">
                    <?php  echo $v ?>
                </label>
            </li>
            <?php
                --$_nav_menu_placeholder;
               endforeach;
            ?>

            <?php if (!empty($this->blogId)) : 
                  $pageName = get_the_title($this->blogId); 
                  $link = get_permalink($this->blogId);
                  // http://127.0.0.1/wp-fix-bug/?page_id=262
            ?>
            <li>
                <!-- <input type="checkbox" name="qva[<?php echo ++$_nav_menu_placeholder ?>][menu-item-checked]" value="1" class="code pirates-qva-menu menu-item-textbox"/> -->
                <label class="menu-item-title">
                <input type="checkbox" name="qva[<?php echo $_nav_menu_placeholder - 1; ?>][menu-item-checked]" value="<?php echo $this->blogId; ?>" class="code pirates-qva-menu menu-item-textbox"/>
                <?php echo $pageName; ?>
                </label>
                <input class="menu-item-db-id" type="hidden" value="0" name="qva[<?php echo $_nav_menu_placeholder - 1; ?>][menu-item-db-id]">
                <input class="menu-item-object" type="hidden" value="page" name="qva[<?php echo $_nav_menu_placeholder - 1; ?>][menu-item-object]">
                <input class="menu-item-parent-id" type="hidden" value="0" name="qva[<?php echo $_nav_menu_placeholder -1 ; ?>][menu-item-parent-id]">
                <input class="menu-item-type" type="hidden" value="post_type" name="qva[<?php echo $_nav_menu_placeholder -1; ?>][menu-item-type]">
                <input class="menu-item-title" type="hidden" value="<?php echo $pageName; ?>" name="qva[<?php echo $_nav_menu_placeholder -1; ?>][menu-item-title]">
                <input class="menu-item-url" type="hidden" value="<?php echo $link;  ?>" name="qva[<?php echo $_nav_menu_placeholder -1 ; ?>][menu-item-url]">
                <input class="menu-item-target" type="hidden" value="" name="qva[<?php echo $_nav_menu_placeholder - 1; ?>][menu-item-target]">
                <input class="menu-item-attr_title" type="hidden" value="" name="qva[<?php echo $_nav_menu_placeholder -1 ; ?>][menu-item-attr_title]">
                <input class="menu-item-classes" type="hidden" value="" name="qva[<?php echo $_nav_menu_placeholder -1 ; ?>][menu-item-classes]">
                <input class="menu-item-xfn" type="hidden" value="" name="qva[<?php echo $_nav_menu_placeholder - 1; ?>][menu-item-xfn]">
                <input class="menu-item-section-name" type="hidden" value="" name="qva[<?php echo $_nav_menu_placeholder - 1; ?>][menu-item-section-name]" value="blog">
            </li>
            <?php endif; ?>


        </ul>
        <p class="button-controls">
            <span class="add-to-menu">
                <input type="submit" class="button-secondary right" value="<?php esc_attr_e('Add to Menu', QVA_LANG); ?>" name="add-custom-menu-item" id="submit-qvamenu" />
                <span class="spinner"></span>
            </span>
        </p>
    </div>
